// index.js 文件
const myPromise = require('./myPromise')

let promise = new myPromise((resolve, reject) => {
  setTimeout(()=>{
    resolve('成功')
  }, 2000)
  // setTimeout(()=>{
    // reject('失败')
  // }, 2000)
})

promise.then(value => {
  console.log(value);
},reason => {
  console.log(reason);
})